using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;

namespace ERP.ERPSystem.ProductionSystem.Dto
{
    /// <summary>
    /// 客户信息 DTO - 用于列表展示
    /// </summary>
    public class CustomerDto : EntityDto<int>
    {
        /// <summary>
        /// 客户编码
        /// </summary>
        public string CustomerCode { get; set; }

        /// <summary>
        /// 客户全称
        /// </summary>
        public string CustomerName { get; set; }

        /// <summary>
        /// 客户昵称/简称
        /// </summary>
        public string CustomerNiciname { get; set; }

        /// <summary>
        /// 客户类型
        /// </summary>
        public string CustomerType { get; set; }

        /// <summary>
        // 客户联系电话
        /// </summary>
        public string CustomerPhone { get; set; }

        /// <summary>
        /// 是否有效/启用
        /// </summary>
        public bool CustomerIsTrue { get; set; }
    }

    /// <summary>
    /// 客户查询输入 DTO
    /// </summary>
    public class GetCustomerInputDto : PagedAndSortedResultRequestDto
    {
        public string? CustomerCode { get; set; }
        public string? CustomerName { get; set; }
        public string? CustomerNiciname { get; set; }
        public bool? CustomerIsTrue { get; set; }
    }

    /// <summary>
    /// 创建或更新客户的 DTO
    /// </summary>
    public class CreateUpdateCustomerDto
    {
        [Required(ErrorMessage = "客户编码不能为空")]
        [MaxLength(50)]
        public string CustomerCode { get; set; }

        [Required(ErrorMessage = "客户名称不能为空")]
        [MaxLength(100)]
        public string CustomerName { get; set; }

        [MaxLength(50)]
        public string? CustomerNiciname { get; set; }

        [MaxLength(50)]
        public string? CustomerType { get; set; }

        [Phone(ErrorMessage = "请输入有效的电话号码")]
        [MaxLength(20)]
        public string? CustomerPhone { get; set; }

        [Required]
        public bool CustomerIsTrue { get; set; }
    }
} 